<template>
	<div>
		<div class="main">
			<div id="text1" style="position: absolute; top: 160px; left: 300px;color: white;">
				<br>
				<p>
					<h1 style="z-index: 7; height: 50px;text-align: left;" class="h_head">紧急救援</h1>
					<h1 style="z-index: 7; height: 40px;text-align: left">The Rescue</h1>
					<p style="z-index: 7; height: 30px;text-align: left; line-height: 30px; color: rgb(225, 161, 90);">'红海''湄公河'金牌班底全新力作</p>
					<p style="z-index: 7; height: 30px;text-align: left">139分钟-剧情/动作</p>
					<p style="z-index: 7; height: 30px;text-align: left">2020年12月18日</p>
					<p style="z-index: 7; height: 30px;text-align: left">2D/杜比影院/中国巨幕</p>
				</p>
				<div style="width: 280px; height: 400px; position: absolute;top: -30px; left: 700px;">
					<img src="../../images/031.jpg" alt="">
				</div>
			</div>
			<el-button type="info" plain style='position: absolute; top: 400px; left: 300px;' @click='goumai'>200积分购买</el-button>
		</div>
		<div class="main1">
			<h2>剧情：</h2>
			<p>
				倾覆沉没的钻井平台，顺流直冲的运油车头，直坠入海的满载客机。交通海上应急反应特勤队队长高谦（彭于晏 饰）、机长方宇凌（辛芷蕾 饰）和绞车手赵呈（王彦霖
				饰）一次次带领队伍第一时间抵达，站在水火咆哮的最前面，守在危急撤离的最后面，用生命对抗天灾人祸。但在自然面前，特勤员毕竟没有超能力，血肉之躯踩在死亡边缘，真实的恐惧无数次让这些斗士颤抖、无助和气馁。而海上救援的字典里没有“退缩”。当你听见旋翼的轰鸣、洪亮的汽笛、马达的飞驰，那是他们无惧艰难险阻，舍己为人，谱写的一曲英雄之歌。

			</p>
		</div>
	</div>
</template>

<script>
	import axios from 'axios'
	import store from "../../store/modules/user.js"
	export default {
		data() {
			return {
				user: store.state.user,
				count: store.state.count
			}
		},
		methods: {
			goumai() {
				const us = localStorage.getItem("username");
				const count = this.count;
				console.log(count);
				var value = event.target.innerHTML;
				var value1 = '';
				for (var i = 0; i < value.length; i++) {
					if (value[i] >= '0' && value[i] <= '9') {
						value1 += value[i];
					}
				}
				var name=document.querySelector(".h_head").innerHTML;
				var params = {}
				params["id"] = this.user.id;
				params["count"] = value1;
				params["name"] =name;
			
				console.log(params);
				var that = this;
				if (this.user.id) {
					axios.post('/user/filmGoumai', params, {
							header: {
								'Content-type': 'application/json;charset=UTF-8'
							}
						})
						.then(function(data) {
								console.log(data);
								alert("购买成功,3秒钟返回首页")
								setTimeout(function() {
									that.$router.push({
										path: "/"
									})
								}, 3000)
							}



						).catch(function(Error) {
							console.log(Error);
						});
				}else {
					alert("没有登录账号，请先登录账号。。。。")
					that.$router.push({
						path: "/index"
					})
				}
			}

		},

		created() {

		}

	}
</script>

<style scoped>
	.main {

		height: 500px;
		background-color: rgb(84, 92, 100);
	}

	.main1 {
		padding-top: 20px;
		width: 1200px;
		margin: 0 auto;
		text-align: left;
		height: 200px;
	}

	img {
		width: 100%;
		height: 100%;
	}
</style>
